package hn.cch.microservice.service_consumer_fallback.feign.client.fallback;

import hn.cch.microservice.service_consumer_fallback.entity.User;
import hn.cch.microservice.service_consumer_fallback.feign.client.UserFeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;

@Component
public class UserFeignClientFallback implements UserFeignClient {
    @Override
    @GetMapping(value = "/{id}")
    public User user(@PathVariable(value = "id") Long id) {
        User user = new User();
        user.setId(0L);
        user.setAccount("account0");
        user.setName("name0");
        user.setAge(0);
        user.setBalance(BigDecimal.valueOf(0));
        return user;
    }
}
